from motor.motor_asyncio import AsyncIOMotorClient
from app.config import settings


client = AsyncIOMotorClient(settings.MONGO_DSN)
db = client[settings.MONGO_DB_NAME]


async def ping_mongo() -> bool:
    try:
        await db.command("ping")
        return True
    except Exception:
        return False